<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>


    <script>
        //string
        var str = "hello"
            // console.log(str.length) //10
            //2.charAt()
            // console.log(str.charAt(2)); //l


        //3.concat()
        // console.log(str.concat("hehe"))
        //4.indexof()
        // console.log(str.indexOf("l"))//2

        //5.lastIndexof()
        // console.log(str.lastIndexOf("l")) //8

        //6.split()
        // var str2 = "192.168.1.66"
        // var arr = str2.split(".");
        // for (var e in arr) {
        //     console.log(arr[e])
        // }

        // //7.sunstring()
        // console.log(str.substring(1, 3)) //el
        // console.log(str.substring(1)) //el

        //8.toUpperCase()
        // console.log(str.toUpperCase())//HELLOWORLD


        ///9.includes()
        // console.log(str.includes("ll"))

        //10.repeat()
        // console.log(str.repeat(3))

        //padStrat()和padEnd()
        //里面有两个参数，第一个是要满足的个数，第二个是不满足个数的情况下，补充的字符
        // // console.log(str.padStart(8, 'o'))
        // console.log(str.padEnd(8, 'x'))


        var reg01 = /[a-z]+/g
        console.log("hello567abc".replace(reg01, "xx")); //xx567xx

        console.log("hello567我们abc".search(reg01)); //


        var reg02 = /[a-z][0-9_]{5}/i;
        console.log("s456782".match(reg02)); //s45678
    </script>
</body>

</html>